import { request } from '@/utils/request'
import type { BannerResult, HostListResult, NewListResult, BannerRequest } from './types/home'
import type { ICategory } from './types/layout'

export const getBannerAPI = (params: BannerRequest) => {
  const { distributionSite = '1' } = params
  return request<BannerResult[]>('/home/banner', 'GET', { distributionSite })
}

export const getNewAPI = () => request<NewListResult[]>('home/new', 'GET')

export const getHotAPI = () => request<HostListResult[]>('home/hot', 'GET')

export const getGoodsAPI = () => request<ICategory[]>('/home/goods', 'GET')
